#ifndef STRING_H_
#define STRING_H_

#include<iostream>

using namespace std;

class String {
	friend ostream &operator<<(ostream &output, const String &str);
	friend istream &operator>>(istream &input, String &str);
public:
	String(const char * = "");
	String(const String &str);
	~String();

	const String &operator=(const String &str);
	const String &operator+=(const String &str);

	bool operator!() const;
	bool operator==(const String &str) const;
	bool operator<(const String &str) const;
	bool operator!=(const String &right) const {
		return !(*this == right);
	}
	bool operator>(const String &right) const {
		return right < *this;
	}
	bool operator<=(const String &right) const {
		return !(right < *this);
	}
	bool operator>=(const String &right) const {
		return !(*this < right);
	}
	char &operator[](int index);
	char operator[](int index) const;
	String operator()(int, int = 0);
	int getLength() const;
private:
	int m_iLength;
	char *m_pStr;

	void setString(const char*);
};

#endif
